@extends('layout.member.master')
@section('menu')
    @include('layout.member.show_menu')
@endsection
@section('content')
    <div class="card">
        <div class="card-header">
            {{$user->name}}的粉丝
        </div>
        <div class="card-body">
            <div class="row">
                @foreach($fans as $fan)
                <div class="col-4">
                    <div class="card">
                        <div class="card-header">
                            {{$fan['name']}}
                        </div>
                        <div class="card-body text-center">
                            <div class="avatar avatar-xl">
                                <img src="{{$fan['icon']}}" alt="..." class="avatar-img rounded-circle">
                            </div>
                        </div>
                        @auth()
                            @can('isSub',$fan)
                                <div class="card-footer">
                                    @if(auth()->user()->isfollowing($fan))
                                        <a href="{{route ('member.follow',$fan)}}" class="btn btn-outline-danger btn-block">取消关注</a>
                                    @else
                                        <a href="{{route ('member.follow',$fan)}}" class="btn btn-outline-success btn-block">关注</a>
                                    @endif
                                </div>
                            @endcan
                        @endauth
                    </div>
                </div>
                @endforeach
            </div>


        </div>
        <div class="card-footer text-muted">
            {{$fans->links()}}
        </div>
    </div>
@endsection
